
 <tr>
  <td width="16%" style="padding-left:20px; min-width:155px" valign="top">

     <SMALL>Интернет-магазин<BR>рыболовных снастей</SMALL><br><br>
     
     <noindex> 
     <div>(044) 440-62-11</div>
     <div>(044) 455-53-81</div><br>
     <SMALL>Пн—Пт: 9:00—18:00</SMALL><br><br>
     <a href="/store/delivery"><small>Доставка и оплата</small></a>
     </noindex> 
  </td>
  
 <td width="16%" style="padding-left:10px; min-width:155px" valign="top">
  
       <? $query = $this->db->query('SELECT link, name,id  FROM store WHERE level=1 AND folder=1 ORDER BY list'); ?>

            <? foreach($query->result() as $row){?>
            <? $i++; ?>
                 <? if(isset($level1)){?>
                      <? if($level1 == $row->link ){ ?>
                      <? $ii1=($i-1); ?>
                      
                                 <? $query = $this->db->query("SELECT link, name,id, folder  FROM store WHERE level=2 AND father=(SELECT id FROM store WHERE link='$level1') AND folder=1 ORDER BY list"); ?>
                                 <?if($query->num_rows() < 2){?>  
                                  
                                  <? $st=1; }?>
                          
                          
                      
                      
                              <? if(isset($level2) && $only!=1){?>
                                  <div class="menu"><a href="/store/catalog/<?=$row->link?>/"><?=$row->name?></a> <? if($st == 1){echo "&darr;";}else{echo "&rarr;";}?></div>
                              <? }else{?>
                                    <div class="menu"><?=$row->name?> <? if($st == 1){echo "&darr;";}else{echo "&rarr;";}?></div>
                              <? }?>
                      <?}else{?>  
                            <div class="menu"><a href="/store/catalog/<?=$row->link?>/"><?=$row->name?></a> </div>  
                      <?}?>
                  <?}else{?> 
                    <div class="menu"><a href="/store/catalog/<?=$row->link?>/"><?=$row->name?></a></div>
            <?}?>
            
          <?}?>  
 </td>
 

 
 
<? //Второй уровень  ?>


  <td width="16%" valign="top" style="padding-left:10px; min-width:155px">
   
   <?$i=1?>
   
 <? while ($i <= $ii1){
      	echo '<div class="menu">&nbsp;</div>';
      	$i++;
  }
  ?>
   
       <? $query = $this->db->query("SELECT link, name,id, folder  FROM store WHERE level=2 AND father=(SELECT id FROM store WHERE link='$level1') AND folder=1 ORDER BY list"); ?>
       <?if($query->num_rows() > 1){?>     
            <? $i=0; ?>
            <? foreach($query->result() as $row){?>
            <? $i++; ?>
                 <? if(isset($level2)){?>
                      <? if($level2 == $row->link){ ?>
                      <? $ii2=($i-1); ?>
                      
                      
                      
                                 <? $query = $this->db->query("SELECT link, name,id, folder  FROM store WHERE level=3 AND father=(SELECT id FROM store WHERE link='$level2' AND father=(SELECT id from store WHERE link='$level1')) AND folder=1 ORDER BY list"); ?>
                                 <?if($query->num_rows() < 2){?>  
                                  
                                 <? $st1=1; }?>
                      
                      
                      
                              <? if(isset($level3)){?>
                                  <div class="secondary_menu"><nobr><a href="/store/catalog/<?=$level1?>/<?=$row->link?>/"><?=$row->name?></a> <? if($st1 == 1){echo "&darr;";}else{echo "&rarr;";}?></nobr></div>
                              <? }else{?>
                                  <div class="secondary_menu"><nobr><?=$row->name?>  <? if($st1 == 1){echo "&darr;";}else{echo "&rarr;";}?></nobr></div>
                              <? }?>
                      <?}else{?>  
                            <div class="secondary_menu"><a href="/store/catalog/<?=$level1?>/<?=$row->link?>/"><?=$row->name?></a></div>  
                      <?}?>
                    <?}else{?> 
                    <div class="secondary_menu"><a href="/store/catalog/<?=$level1?>/<?=$row->link?>/"><?=$row->name?></a></div>
            <?}?>
          <?}?>  
        
        <?}?>
 
 </td>
 

 
 
 <? //Третий уровень  ?>

<? 
if ($this->uri->segment(2) === FALSE ){
?>

<td valign="top"  style="padding-left:10px">


</td>


<?}else{?>


  <td valign="top"  style="padding-left:10px">
   
 <? 
 $i=1;
 while ($i <= $ii1){
      	echo '<div class="menu">&nbsp;</div>';
      	$i++;
  }


 $i=1;
 while ($i <= $ii2){
      	echo '<div class="secondary_menu">&nbsp;</div>';
      	$i++;
  }
?>
   
       <? $query = $this->db->query("SELECT link, name,id, folder  FROM store WHERE level=3 AND father=(SELECT id FROM store WHERE link='$level2' AND father=(SELECT id from store WHERE link='$level1')) AND folder=1 ORDER BY list"); ?>
        <?if($query->num_rows() > 1){?>      
            <? foreach($query->result() as $row){?>
            
            <? if ($row->name=='~')
                $row->name='';
                
             ?>
            
                  <? if(isset($level3)){?>
                      <? if($level3 == $row->link){ ?> 
                              <? if(isset($level4)){?>
                                  <div class="secondary_menu"><nobr><a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$row->link?>/"><?=$row->name?></a> <? if ($row->name != '') echo "&darr;";?></nobr></div>
                              <? }else{?>
                                   <div class="secondary_menu"><?=$row->name?> <?="&darr;"?></div>
                              <? }?>
                      <?}else{?>  
                           <div class="secondary_menu"><a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$row->link?>/"><?=$row->name?></a> </div>  
                      <?}?>
                 <?}else{?> 
                    <div class="secondary_menu"><a href="/store/catalog/<?=$level1?>/<?=$level2?>/<?=$row->link?>/"><?=$row->name?></a></div>
              <?}?>
         <?}?>  
      <?}?>
 </td>
 


<?}?>
 
 
 <td valign="top" colspan="2" style="padding-left:10px">

 </td>
 
   </tr>
   </table>
   
<noindex>   
 <DIV id="LoginPanel" style="display:none;position:absolute; right: 10px; top: 0; background-color:#EFEDD9; padding:10px 10px 10px 10px;border: outset 1px;width:16%;z-index:3;font-size:0.9em">
    <div align="right"><a href="#" onclick="return ToggleLoginPanel()" class="login_b">Вход с паролем</a></div>
    
    <FORM action="/registration/login" method="post" style="padding:0;margin:0;">
      <DIV class="l">Эл. почта</DIV>
      <INPUT name="login" type="text"  style="position: relative; width: 100%;margin-bottom:0.5em">
      <DIV class="l">Пароль</DIV>
      <INPUT name="pass" type="password" style="position: relative; width: 100%;margin-bottom:0.5em"><BR>
      <INPUT value="Вход" type="submit"><br><br>
      <DIV class="l"><a href="/registration/lost">Забыли пароль?</a></DIV><br>
      <DIV class="l"><a href="/registration/new_user">Регистрация</a></DIV>
    </FORM>
</DIV> 
</noindex>   
   
<DIV class="all">   